<!-- 文字组件 -->
<template>
  <div>
    <input class="text" :style="{top:((clientY - 97)+'px'),left:((clientX - 233)+'px')}" :placeholder="label" @dblclick="textDBclick($event)" />
  </div>
</template>

<script>
export default {
  props: {
    clientX: {
      type: Number,
      required: true
    },
    clientY: {
      type: Number,
      required: true
    },
    label:{
      type: String,
      default(){
        return '请输入文字'
      }
    }
  },
  data() {
    return {};
  },

  // components: {},

  // computed: {},

  // mounted: {},

  methods: {
    textDBclick(e){
      e.target.focus();
    }
  },
};
</script>
<style lang='less' scoped>
.text {
  // 'top':(clientY-97)+'px',
  // 'left':(clientX-233)+'px',
  width: 100px;
  height: 33px;
  font-size: 14px;
  text-align: center;
  line-height: 33px;
  position: absolute;
  border: 1px solid rgb(186 86 86);
  cursor: all-scroll;
}
</style>